﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using System.Configuration;

namespace SeleniumToolkit.Config
{
    public class BrowserMapSpecs : SpecFor<BrowserMapElementCollection>
    {
        public override BrowserMapElementCollection InitializeSubject()
        {
            return new BrowserMapElementCollection();
        }

        /// <summary>
        /// iexplorer
        /// firefox
        /// firefox2
        /// firefox3
        /// googlechrome
        /// opera
        /// safari
        /// konqueror
        /// ---
        /// iexplorerproxy
        /// firefoxproxy
        /// safariproxy
        /// chrome / firefoxchrome
        /// iehta
        /// </summary>
        [TestFixture]
        public class WhenCreatingBrowserMap : BrowserMapSpecs
        {
            
            [Test]
            public void ShouldContainDefaultValues()
            {
                subject.Count.ShouldEqual(6);
            }

            [Test]
            public void ShouldContainDefaultIE()
            {
                subject["*iexplore"].ShouldNotBeNull()
                                    .Value.ShouldEqual("*iexplore");
            }

            [Test]
            public void ShouldContainDefaultFirefox()
            {
                subject["*firefox"].ShouldNotBeNull()
                                   .Value.ShouldEqual("*firefox");
            }

            [Test]
            public void ShouldContainDefaultOpera()
            {
                subject["*opera"].ShouldNotBeNull()
                                 .Value.ShouldEqual("*opera");
            }

            [Test]
            public void ShouldContainDefaultSafari()
            {
                subject["*safari"].ShouldNotBeNull()
                                  .Value.ShouldEqual("*safari");
            }

            [Test]
            public void ShouldContainDefaultGoogleChrome()
            {
                subject["*googlechrome"].ShouldNotBeNull()
                                  .Value.ShouldEqual("*googlechrome");
            }

            [Test]
            public void ShouldContainDefaultKonqueror()
            {
                subject["*konqueror"].ShouldNotBeNull()
                                  .Value.ShouldEqual("*konqueror");
            }
        }
    }

    
}
